<?php class Buildinginfo { 

    /***
     * DB Fields: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $id;

    /***
     * DB Fields: name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $name;

    /***
     * DB Fields: description
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $description;

    /***
     * DB Fields: image
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $image;

    /***
     * DB Fields: priceRatio
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $priceRatio;

    /***
     * DB Fields: priceMetal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $priceMetal;

    /***
     * DB Fields: priceCrystal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $priceCrystal;

    /***
     * DB Fields: priceDeuterium
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $priceDeuterium;

    /***
     * DB Fields: priceEnergy
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $priceEnergy;

    /***
     * DB Fields: startLevel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $startLevel;

    /***
     * DB Fields: order
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $order;

    /***
     * DB Fields: metalPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $metalPerHour;

    /***
     * DB Fields: crystalPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $crystalPerHour;

    /***
     * DB Fields: deuteriumPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $deuteriumPerHour;

    /***
     * DB Fields: energyConsumed
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $energyConsumed;

//--------------- GET METHODS ----------------------------- //
    /***
     * Get value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result id
     **/
    function get_id( ) {
        // returns the value of id
        return $this->id;
    }


    /***
     * Get value for field: name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result name
     **/
    function get_name( ) {
        // returns the value of name
        return $this->name;
    }


    /***
     * Get value for field: description
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result description
     **/
    function get_description( ) {
        // returns the value of description
        return $this->description;
    }


    /***
     * Get value for field: image
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result image
     **/
    function get_image( ) {
        // returns the value of image
        return $this->image;
    }


    /***
     * Get value for field: priceRatio
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result priceRatio
     **/
    function get_priceRatio( ) {
        // returns the value of priceRatio
        return $this->priceRatio;
    }


    /***
     * Get value for field: priceMetal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result priceMetal
     **/
    function get_priceMetal( ) {
        // returns the value of priceMetal
        return $this->priceMetal;
    }


    /***
     * Get value for field: priceCrystal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result priceCrystal
     **/
    function get_priceCrystal( ) {
        // returns the value of priceCrystal
        return $this->priceCrystal;
    }


    /***
     * Get value for field: priceDeuterium
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result priceDeuterium
     **/
    function get_priceDeuterium( ) {
        // returns the value of priceDeuterium
        return $this->priceDeuterium;
    }


    /***
     * Get value for field: priceEnergy
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result priceEnergy
     **/
    function get_priceEnergy( ) {
        // returns the value of priceEnergy
        return $this->priceEnergy;
    }


    /***
     * Get value for field: startLevel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result startLevel
     **/
    function get_startLevel( ) {
        // returns the value of startLevel
        return $this->startLevel;
    }


    /***
     * Get value for field: order
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result order
     **/
    function get_order( ) {
        // returns the value of order
        return $this->order;
    }


    /***
     * Get value for field: metalPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result metalPerHour
     **/
    function get_metalPerHour( ) {
        // returns the value of metalPerHour
        return $this->metalPerHour;
    }


    /***
     * Get value for field: crystalPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result crystalPerHour
     **/
    function get_crystalPerHour( ) {
        // returns the value of crystalPerHour
        return $this->crystalPerHour;
    }


    /***
     * Get value for field: deuteriumPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result deuteriumPerHour
     **/
    function get_deuteriumPerHour( ) {
        // returns the value of deuteriumPerHour
        return $this->deuteriumPerHour;
    }


    /***
     * Get value for field: energyConsumed
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result energyConsumed
     **/
    function get_energyConsumed( ) {
        // returns the value of energyConsumed
        return $this->energyConsumed;
    }


//--------------- SET METHODS ----------------------------- //
    /***
     * Set value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function set_id( $id ) {
        // sets the value of id
        $this->id = $id;
    }

    /***
     * Set value for field: name
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param name
     * @result void
     **/
    function set_name( $name ) {
        // sets the value of name
        $this->name = $name;
    }

    /***
     * Set value for field: description
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param description
     * @result void
     **/
    function set_description( $description ) {
        // sets the value of description
        $this->description = $description;
    }

    /***
     * Set value for field: image
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param image
     * @result void
     **/
    function set_image( $image ) {
        // sets the value of image
        $this->image = $image;
    }

    /***
     * Set value for field: priceRatio
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param priceRatio
     * @result void
     **/
    function set_priceRatio( $priceRatio ) {
        // sets the value of priceRatio
        $this->priceRatio = $priceRatio;
    }

    /***
     * Set value for field: priceMetal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param priceMetal
     * @result void
     **/
    function set_priceMetal( $priceMetal ) {
        // sets the value of priceMetal
        $this->priceMetal = $priceMetal;
    }

    /***
     * Set value for field: priceCrystal
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param priceCrystal
     * @result void
     **/
    function set_priceCrystal( $priceCrystal ) {
        // sets the value of priceCrystal
        $this->priceCrystal = $priceCrystal;
    }

    /***
     * Set value for field: priceDeuterium
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param priceDeuterium
     * @result void
     **/
    function set_priceDeuterium( $priceDeuterium ) {
        // sets the value of priceDeuterium
        $this->priceDeuterium = $priceDeuterium;
    }

    /***
     * Set value for field: priceEnergy
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param priceEnergy
     * @result void
     **/
    function set_priceEnergy( $priceEnergy ) {
        // sets the value of priceEnergy
        $this->priceEnergy = $priceEnergy;
    }

    /***
     * Set value for field: startLevel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param startLevel
     * @result void
     **/
    function set_startLevel( $startLevel ) {
        // sets the value of startLevel
        $this->startLevel = $startLevel;
    }

    /***
     * Set value for field: order
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param order
     * @result void
     **/
    function set_order( $order ) {
        // sets the value of order
        $this->order = $order;
    }

    /***
     * Set value for field: metalPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param metalPerHour
     * @result void
     **/
    function set_metalPerHour( $metalPerHour ) {
        // sets the value of metalPerHour
        $this->metalPerHour = $metalPerHour;
    }

    /***
     * Set value for field: crystalPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param crystalPerHour
     * @result void
     **/
    function set_crystalPerHour( $crystalPerHour ) {
        // sets the value of crystalPerHour
        $this->crystalPerHour = $crystalPerHour;
    }

    /***
     * Set value for field: deuteriumPerHour
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param deuteriumPerHour
     * @result void
     **/
    function set_deuteriumPerHour( $deuteriumPerHour ) {
        // sets the value of deuteriumPerHour
        $this->deuteriumPerHour = $deuteriumPerHour;
    }

    /***
     * Set value for field: energyConsumed
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param energyConsumed
     * @result void
     **/
    function set_energyConsumed( $energyConsumed ) {
        // sets the value of energyConsumed
        $this->energyConsumed = $energyConsumed;
    }

//--------------- CRUD METHODS ----------------------------- //
    /***
     * Create a new Record: buildinginfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param name
     * @param description
     * @param image
     * @param priceRatio
     * @param priceMetal
     * @param priceCrystal
     * @param priceDeuterium
     * @param priceEnergy
     * @param startLevel
     * @param order
     * @param metalPerHour
     * @param crystalPerHour
     * @param deuteriumPerHour
     * @param energyConsumed
     * @result void
     **/
    function createnew_buildinginfo( $id, $name, $description, $image, $priceRatio, $priceMetal, $priceCrystal, $priceDeuterium, $priceEnergy, $startLevel, $order, $metalPerHour, $crystalPerHour, $deuteriumPerHour, $energyConsumed ) {

        // items to be inserted in the database 
        $_obj = array($id,
                      $name,
                      $description,
                      $image,
                      $priceRatio,
                      $priceMetal,
                      $priceCrystal,
                      $priceDeuterium,
                      $priceEnergy,
                      $startLevel,
                      $order,
                      $metalPerHour,
                      $crystalPerHour,
                      $deuteriumPerHour,
                      $energyConsumed); 

        // database object connection
        $dbConn = $GLOBALS['dbConn'];

        // perform insert in the database
        $dbConn->insert("buildinginfo", $_obj);
    }

    /***
     * Retrived an existing record: buildinginfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result new Buildinginfo
     **/
    function get_buildinginfo( $id ) {

        // retrive the data
        $dbConn = $GLOBALS['dbConn'];

        // retrieved value in the database
        $_resultSet = $dbConn->doQuery("SELECT * FROM buildinginfo WHERE id = '$id'");

        $__buildinginfoObj = new buildinginfo();
        // return the retrived from the database

        // create a new object
        $__obj = new Buildinginfo();
        $__obj->set_id($_resultSet[0]['id']);
        $__obj->set_name($_resultSet[0]['name']);
        $__obj->set_description($_resultSet[0]['description']);
        $__obj->set_image($_resultSet[0]['image']);
        $__obj->set_priceRatio($_resultSet[0]['priceRatio']);
        $__obj->set_priceMetal($_resultSet[0]['priceMetal']);
        $__obj->set_priceCrystal($_resultSet[0]['priceCrystal']);
        $__obj->set_priceDeuterium($_resultSet[0]['priceDeuterium']);
        $__obj->set_priceEnergy($_resultSet[0]['priceEnergy']);
        $__obj->set_startLevel($_resultSet[0]['startLevel']);
        $__obj->set_order($_resultSet[0]['order']);
        $__obj->set_metalPerHour($_resultSet[0]['metalPerHour']);
        $__obj->set_crystalPerHour($_resultSet[0]['crystalPerHour']);
        $__obj->set_deuteriumPerHour($_resultSet[0]['deuteriumPerHour']);
        $__obj->set_energyConsumed($_resultSet[0]['energyConsumed']);


        return $__obj;
    }

    /***
     * Update an existing record: buildinginfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param itemsToBeUpdated = array()
     * @result void
     **/
    function update_buildinginfo( $id, $itemsToBeUpdated = array() ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs update in the database
         foreach($itemsToBeUpdated as $_fName => $_fVal) { 
               $dbConn->addValuePair($_fName, $_fVal);
         }

         // perform update operation
         $dbConn->update("buildinginfo", "id = '$id'");
    }

    /***
     * Delete an existing record: buildinginfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function delete_buildinginfo( $id ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs deletion of data
         $dbConn->delete("buildinginfo", "id = '$id'");
    }

    /***
     * Retrived list of objects base on a given parameters: buildinginfo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param conditionalStatement = ''
     * @result collection of objects: Buildinginfo
     **/
    function list_buildinginfo( $conditionalStatement = '' ) {

         $dbConn = $GLOBALS['dbConn'];
         // check if there is a given parameter list
         if(!empty($conditionalStatement)) { 
              $sqlStatement = "SELECT * FROM buildinginfo WHERE $conditionalStatement"; 
         } else { 
              $sqlStatement = "SELECT * FROM buildinginfo";
         }

         // retrieve the values base on the query result
         $__resObj = $dbConn->doQuery($sqlStatement);

         $__collectionOfObjects = array();
         foreach($__resObj as $__rs) { 
            $__newObj = new Buildinginfo();

            $__newObj->set_id($__rs['id']);
            $__newObj->set_name($__rs['name']);
            $__newObj->set_description($__rs['description']);
            $__newObj->set_image($__rs['image']);
            $__newObj->set_priceRatio($__rs['priceRatio']);
            $__newObj->set_priceMetal($__rs['priceMetal']);
            $__newObj->set_priceCrystal($__rs['priceCrystal']);
            $__newObj->set_priceDeuterium($__rs['priceDeuterium']);
            $__newObj->set_priceEnergy($__rs['priceEnergy']);
            $__newObj->set_startLevel($__rs['startLevel']);
            $__newObj->set_order($__rs['order']);
            $__newObj->set_metalPerHour($__rs['metalPerHour']);
            $__newObj->set_crystalPerHour($__rs['crystalPerHour']);
            $__newObj->set_deuteriumPerHour($__rs['deuteriumPerHour']);
            $__newObj->set_energyConsumed($__rs['energyConsumed']);

            // add object to collection 
            array_push($__collectionOfObjects, $__newObj);
         }

         // return collection of objects
         return $__collectionOfObjects;
    }

} ?>